<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
<h:head>
	<title>User list</title>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF8" />
</h:head>
<h:body>
	<h4>
		You are logined <a href="logout">logout</a>
	</h4>
	<hr />
	<h:form>
		<h:dataTable value="${apps.trips}" var="trip" frame="box"
			rules="all">
			<h:column>
				<f:facet name="header">App ID</f:facet>
                    #{trip.app.id}
                </h:column>
			<h:column>
				<f:facet name="header">minspeed</f:facet>
                    #{trip.app.minspeed}
                </h:column>
			<h:column>
				<f:facet name="header">minbusload</f:facet>
                    #{trip.app.minbusload}
                </h:column>
			<h:column>
				<f:facet name="header">Driver Id</f:facet>
                                #{trip.driver.id}
                            </h:column>
			<h:column>
				<f:facet name="header">Driver name</f:facet>
                                #{trip.driver.name}
                            </h:column>
			<h:column>
				<f:facet name="header">Driver login</f:facet>
                                #{trip.driver.login}
                            </h:column>

			<h:column>
				<!-- 
						<h:inputText name = "#{driver.id}" value = 'free'
							onselect = "changeUse('#{driver.id}')" readonly = "true"
							style = "color: Yellow; background: Teal;">
						</h:inputText>
						 -->
				<h:selectBooleanCheckbox value= "#{trip.needToCreate}" />
			</h:column>
			</h:dataTable>
			<h:commandButton action = "#{apps.doSome}"/>
	</h:form>
	


</h:body>

<script type="text/javascript">
<!--//<![CDATA[
	function changeUse(name) {

		alert(name);

		var inp = document.getElementByName(name);

		if (inp.value == "free") {
			alert("free " + inp.value);
			inp.value = "busy";
		} else {
			inp.value = "free";
		}
	}
//]]>-->
</script>
</html>